package com.u3k.mid;

import android.content.Context;
import android.os.Process;
import com.u3k.app.mid.utils.statistics.StatisticsManager;

public class av {
    public static boolean a(Context context, String str) {
        return context.checkPermission(str, Process.myPid(), Process.myUid()) == 0;
    }

    public static String[] a(Context context) {
        try {
            return context.getPackageManager().getPackageInfo(context.getPackageName(), 4096).requestedPermissions;
        } catch (Exception e) {
            LogUtils.a("error", e);
            StatisticsManager.getInstance().logException(ae.a(), e);
            return null;
        }
    }

    public static boolean b(Context context, String str) {
        try {
            String[] strArr = context.getPackageManager().getPackageInfo(context.getPackageName(), 4096).requestedPermissions;
            for (Object equals : strArr) {
                if (str.equals(equals)) {
                    return true;
                }
            }
            return false;
        } catch (Exception e) {
            LogUtils.a("error", e);
            StatisticsManager.getInstance().logException(ae.a(), e);
            return false;
        }
    }
}
